package com.linrui.car.es.doc;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;

@Data
@Document(indexName = "car",type = "CarDoc")
@NoArgsConstructor
@AllArgsConstructor
public class CarDoc {

    @Id
    private Long id;

    @Field(type = FieldType.Text, analyzer = "ik_smart", searchAnalyzer = "ik_smart")
    private String title;

    @Field(type = FieldType.Keyword)
    private String cover;

    @Field(type = FieldType.Double)
    private BigDecimal saleprice;

    @Field(type = FieldType.Double)
    private BigDecimal costprice;

    @Field(type = FieldType.Integer)
    private Integer isnew;

    @Field(type = FieldType.Date)
    @JsonFormat(pattern = "yyyy-MM")
    private Date reigstertime;

    @Field(type = FieldType.Double)
    private Double mileage;

    @Field(type = FieldType.Long)
    private Long shopId;

    @Field(type = FieldType.Text, analyzer = "ik_smart", searchAnalyzer = "ik_smart")
    private String shopName;

    @Field(type = FieldType.Keyword)
    private String shopAddress;

    @Field(type = FieldType.Date)
    private Date onsaletime;

    @Field(type = FieldType.Integer)
    private Integer costeffective;

    @Field(type = FieldType.Integer)
    private Integer rushsale;

    @Field(type = FieldType.Integer)
    private Integer quasinewcar;

    @Field(type = FieldType.Integer)
    private Integer transitivecountry;

    @Field(type = FieldType.Long)
    private Long typeId;

    @Field(type = FieldType.Text, analyzer = "ik_smart", searchAnalyzer = "ik_smart")
    private String typeName;

    @Field(type = FieldType.Text, analyzer = "ik_smart", searchAnalyzer = "ik_smart")
    private String carInfo;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public BigDecimal getSaleprice() {
        return saleprice;
    }

    public void setSaleprice(BigDecimal saleprice) {
        this.saleprice = saleprice;
    }

    public BigDecimal getCostprice() {
        return costprice;
    }

    public void setCostprice(BigDecimal costprice) {
        this.costprice = costprice;
    }

    public Integer getIsnew() {
        return isnew;
    }

    public void setIsnew(Integer isnew) {
        this.isnew = isnew;
    }

    public Date getReigstertime() {
        return reigstertime;
    }

    public void setReigstertime(Date reigstertime) {
        this.reigstertime = reigstertime;
    }

    public Double getMileage() {
        return mileage;
    }

    public void setMileage(Double mileage) {
        this.mileage = mileage;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getShopAddress() {
        return shopAddress;
    }

    public void setShopAddress(String shopAddress) {
        this.shopAddress = shopAddress;
    }

    public Date getOnsaletime() {
        return onsaletime;
    }

    public void setOnsaletime(Date onsaletime) {
        this.onsaletime = onsaletime;
    }

    public Integer getCosteffective() {
        return costeffective;
    }

    public void setCosteffective(Integer costeffective) {
        this.costeffective = costeffective;
    }

    public Integer getRushsale() {
        return rushsale;
    }

    public void setRushsale(Integer rushsale) {
        this.rushsale = rushsale;
    }

    public Integer getQuasinewcar() {
        return quasinewcar;
    }

    public void setQuasinewcar(Integer quasinewcar) {
        this.quasinewcar = quasinewcar;
    }

    public Integer getTransitivecountry() {
        return transitivecountry;
    }

    public void setTransitivecountry(Integer transitivecountry) {
        this.transitivecountry = transitivecountry;
    }

    public Long getTypeId() {
        return typeId;
    }

    public void setTypeId(Long typeId) {
        this.typeId = typeId;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getCarInfo() {
        return carInfo;
    }

    public void setCarInfo(String carInfo) {
        this.carInfo = carInfo;
    }
}
